import React from 'react'
import { HashRouter as Router, useRoutes } from 'react-router-dom'
import Nprogress from './Nprogress'
import course from './course'
import { AliveScope } from 'react-activation'
import Login from '@/pages/Login'
import { Layout } from '@/ui'

const routes = [
  {
    path: '/',
    element: <Layout />,
    children: course,
  },
  {
    path: '/login',
    element: <Login />,
  },
]

export default function App() {
  const CourceRoute = () => useRoutes(routes)

  return (
    <Router>
      <AliveScope>
        <CourceRoute />
      </AliveScope>
    </Router>
  )
}
